<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>发布学习资源</title>
</head>
<body>
<script type="text/javascript">
function isInteger(obj) {
    return obj%1 === 0
}

function check(){
var month=releaseResource_form.uploadTimeMonth.value;
var day=releaseResource_form.uploadTimeDay.value;
if(isInteger(month)&&isInteger(day)&&day>0&&day<=31&&month>0&&month<=12){
	return true;
}
else{
	alert("上传日期有误，无法上传");
	return false;
}
}

</script>
<% String uploadID="";
if(session.getAttribute("session_userName")!=null){
	uploadID=session.getAttribute("session_userName").toString();
}
else if(session.getAttribute("session_admin")!=null){
	uploadID=session.getAttribute("session_admin").toString();
}%>
<link href="css/myRelease_teacher.css" rel="stylesheet" type="text/css" />
	<div class="header">
		<font size="6" color="#62A8EA"><br />&emsp;&emsp;&emsp;发布学习资源</font>
	</div>
	<div class="body">
	<form action="UploadServlet" method="post" enctype="multipart/form-data" name="releaseResource_form" onsubmit="return check();">
	<table class="dataintable">
	<input type="hidden" name="uploadType" value="LearningResource"/>
	<tr>
	<td align="center">上传者：</td>
	<td colspan="6"><input type="text" value=<%=uploadID %> name="uploader"></td>
	</tr>
	<tr>
	<td align="center">请选择上传文件：</td>
	<td colspan="6"><input type="file" name="fileName"></td>
	</tr>
	<tr>
	<td align="center">请选择标签：</td>
	<td colspan="6"><select name="label">
	<option value="andriod">Andriod</option>
	<option value="c">C</option>
	<option value="java">java</option>
	<option value="jsp">jsp</option>
	<option value="mysql">MySql</option>
	<option value="oracle">Oracle</option>
	<option value="php">PHP</option>
	<option value="python">python</option>
	<option value="sqlsever">SQL Sever</option>
	<option value="AI">AI</option>
	<option value="other">other</option>
	</select></td>
	</tr>
	<tr>
	<td align="center">资源名称：</td>
	<td colspan="6"><input type="text" name="resourceName"><b>名称就写上传文件的名称，注意要加文件类型后缀以及名称中不要带空格</b></td>
	</tr>
	<tr><td align="center">上传时间：</td>
				<td><input type="text" name="uploadTimeYear"></td><td>年</td>
				<td><input type="text" name="uploadTimeMonth"></td><td>月</td>
				<td><input type="text" name="uploadTimeDay"></td><td>日</td>
				</tr>
				<tr><td align="center">简介：</td><td colspan="6"><textarea name="briefIntroduce" rows="6" cols="50"></textarea></td></tr>
				<tr>
					<td align="center" colspan="7"><input type="submit"
						class="mybutton" value="上传"></td>
				</tr>
	</table>
	</form>
	</div>

</body>
</html>